Skip to main content

floor

Type​

function

Summary​

Returns the greatest integer less than or equal to number.

Syntax​

the floor of <number>
floor(<number>)

Description​

Use the floor function to return the greatest integer less than or equal to a number.

The floor function is different from round in that floor completely ignores the fractional part of the number. For example, floor(5.1) returns 5, but floor(4.99) returns 4. This means that the floor function does not always return the integer closest to the number.

Parameters​

NameTypeDescription

number

Any number, or expression that evaluates to a number.

Examples​

floor(33.567) -- result is 33
floor(-6.3) -- result is -7

Value​

NameTypeDescription

return

The floor function returns an integer.

function: ceiling, round, abs, trunc

glossary: return

keyword: integer

control structure: function

Compatibility and Support​

Introduced

LiveCode 7.1

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?